import React, { Component } from 'react'
/* 
  注意点：只要类组件有生命周期
*/
import LifeCycle3 from './components/LifeCycle3'
export default class App extends Component {
  // getChildMsg=()=>{
  //   this.forceUpdate()
  // }
  constructor(){
    super()
    this.state={
      isShow:true
    }
  }
  toggle=()=>{
    this.setState({
      isShow:!this.state.isShow
    })
  }
  render() {
    return (
      <>
         {/* <LifeCycle2 info={{title:'生命周期演示'}} callback={this.getChildMsg}></LifeCycle2> */}
         {this.state.isShow? <LifeCycle3/>:null}
         <button  onClick={this.toggle}>switch</button>
      </>
    )
  }
}
